package top.linruchang.dao;

import org.apache.ibatis.annotations.*;
import org.apache.ibatis.mapping.FetchType;
import top.linruchang.domain.Parameter1;
import top.linruchang.domain.Parameter2;
import top.linruchang.domain.UmsRole;
import top.linruchang.domain.User;

import java.util.List;

/**
 * @Classname UserDao
 * @Description
 * @Date 2020/3/15 13:00
 * @Created by lrc
 */
public interface UserDao {



//    @Select("select * from ums_user where id = #{id}")
//    @Results(
//            id = "userMap",
//            value = {
//                @Result(property = "user_id", column = "id"),
//                @Result(property = "role_id", column = "role_id"),
//                @Result(property = "loginName", column = "loginName"),
//                @Result(property = "password", column = "password"),
//                @Result(property = "nickname", column = "nickname"),
//                @Result(property = "headImg", column = "headImg"),
//                @Result(property = "role", column = "role_id", javaType = UmsRole.class, one = @One(select="top.linruchang.dao.RoleDao.findById", fetchType = FetchType.EAGER)),
//                @Result(property = "orders", column = "id", javaType = List.class, many = @Many(select = "top.linruchang.dao.OrderDao.findByUserId", fetchType = FetchType.LAZY)),
//            }
//    )
    public User findById(Integer id);
    public List<User> findById2(@Param("nickname") String nickname);
    public List<User> findById3(@Param("parameter1") Parameter1 parameter1, @Param("parameter2") Parameter2 parameter2);
    public List<User> findById4(@Param("parameter1") Parameter1 parameter1, @Param("parameter2") Parameter2 parameter2);

//    @Select("select * from ums_user")
//    @ResultMap("userMap")
    public List<User> findAll();







}
